{block heading}
<h2>Seznam položek v menu: <b>{=$menu->getTitle()}</b></h2>

<p class="quick-nav">
    <a n:href=":Admin:MenuItem:new menu_id => $menu->getId()">Vytvořit novou položku menu</a>
</p>
{/block}
{block content}
{if count($items) > 0}
<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
    <tr>
        <th class="table-header-repeat line-left">
            <a href="#">Titulek</a>
        </th>
        <th class="table-header-repeat line-left">
            <a href="#">Stránka</a>
        </th>
        <th class="table-header-repeat line-left">
            <a href="#">Priorita</a>
        </th>
    </tr>
    {foreach $items as $item}
    <tr{if $iterator->isEven()} class="alternate-row"{/if}>
        <td class="gridito-cell">
            {for $i = 0; $i < $item["level"]; $i++}
                -
            {/for}
            {=$item['item']->getTitle()}
        </td>
        <td class="gridito-cell">
             {if !$item['item']->getId_page()}
                Není přiřazena
             {else}
                {var $type = $item['item']->getPage_type()}
                <a n:href=":Admin:$type:edit $item['item']->getId_page()">{$item['item']->getPage_title()}</a>
             {/if}
            
        </td>
        <td class="gridito-cell">
            {=$item['item']->getPriority()}
        </td>
        <td class="gridito-actioncell">
            <a href="{link :Admin:MenuItem:edit menu_id => $menu->getId(), id => $item['item']->getId()}" id="menu-edit-{!$item['item']->getId()}">Upravit</a>
        <script type="text/javascript">
            $( "#menu-edit-{!$item['item']->getId()}" ).button({
            icons: {
                primary: "ui-icon-pencil"
            },
            text: false
        })
        </script>
        </td>
    </tr>
    {/foreach}
</table>
{/if}
{/block}